package itsm.isperp.report.paser;

import itsm.isperp.report.data.warehouse.QueryRequest;

/**
 * 
 * 查询请求解析器
 * 
 * @author lizx
 * @date 2015-9-6
 * @since 1.0
 * 
 */
public class QueryRequestPaser {

	public static String parseRequest(String gt, QueryRequest qr) {
		String g = "";
		if (gt == null) {
			return g;
		}

		switch (gt) {
		case "1":
			g = "confirmtimeman_name";
			break;
		case "2":
			g = "solver_department_path";
			break;
		case "3":
			g = "icd_category_name";
			break;
		case "4":
			g = "solver_name";
			break;
		case "5":
			g = "incident_type";
			break;
		case "6":
			g = "priority_name";
			break;
		case "8":
      g = "cus_department_path";
      break;
		}
		return g;
	}
	public static String parseRequest(String gt, QueryRequest qr,String moduleName) {
		String g = "";
		if (gt == null) {
			return g;
		}

		switch (gt) {
		case "1":
			g = "confirmtimeman_name";
			break;
		case "2":
			g = "solver_department_path";
			break;
		case "3":
			if(moduleName.toUpperCase().equals("INCIDENT"))
			{
				g = "icd_category_name";
			}else if(moduleName.toUpperCase().equals("CHANGE"))
			{
				g = "chg_category_name";
			}
			
			break;
		case "4":
			g = "solver_name";
			break;
		case "5":
			if(moduleName.toUpperCase().equals("INCIDENT"))
			{
				g = "incident_type";
			}else if(moduleName.toUpperCase().equals("CHANGE"))
			{
				g = "change_type";
			}else
			{
				g = "incident_type";
			}
			break;
		case "6":
			
			if(moduleName.toUpperCase().equals("INCIDENT"))
			{
				g = "priority_name";
			}else if(moduleName.toUpperCase().equals("CHANGE"))
			{
				g = "risk_rank";
			}else
			{
				g = "priority_name";
			}
			break;
		case "8":
      g = "cus_department_path";
      break;
		}
		return g;
	}
}
